//
//  QQFriendGroup.m
//  练习tableView
//
//  Created by brother on 16/2/18.
//  Copyright © 2016年 brother. All rights reserved.
//
//@property (nonatomic, copy) NSString *name;
//
//@property (nonatomic, assign) NSNumber *online;
//
//@property (nonatomic, strong) NSArray *groupfriend;
//
//@property (nonatomic, assign, getter=isOpen) BOOL open;
#import "QQFriendGroup.h"
#import "QQFriend.h"

@implementation QQFriendGroup

+ (instancetype)friendGroupWithDict:(NSDictionary *)dict {
    return [[self alloc] initWithDict:dict];
}

- (instancetype)initWithDict:(NSDictionary *)dict {
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
        NSArray *array = dict[@"friend"];
        NSMutableArray *muArray = [NSMutableArray array];
        [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            QQFriend *qqFriend = [[QQFriend alloc] initWithDict:obj];
            [muArray addObject:qqFriend];
            NSLog(@"%@",qqFriend.name);
        }];
        self.groupFriend = muArray;
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

//- (void)setValue:(id)value forKey:(NSString *)key {
//    
//}

@end
